﻿#include "createComponet.h"
#include "componentmanager.h"
#include "common_log.h"


//#include "wcs/wcsreciver.h"
//#include "wcs/WCSSend.h"
//#include "taskProcess/TaskProcess.h"
//#include "stackplate/stackplatemanager.h"
//#include "platestack/platestack.h"
//#include "unstackplate/unstackplatemanager.h"
//#include "boxline/BoxlineManager.h"
//#include "algorithm/AlgorithmManager.h"
#include "robot/robot.h"
//#include "other/systemstateinfo.h"
//#include "sql/database.h"
////#include "other/platestack.h"
//#include "other/stackinfomanager.h"
//#include "other/statusnotification.h"
//#include "grating/grating.h"
//#include "safe/safedoor.h"
//#include "safe/safelocker.h"
//#include "safe/alarmlight.h"
//#include "tcp/scanner.h"

QVector<ComponentType> CreateProjectComponent()
{
	QVector<ComponentType> all;
	all << ComponentType::component_robot;

	return all;
}



Component* CreateComponet(const ComponentType& type)
{
	Component* base = nullptr;
	switch (type)
	{
	//case ComponentType::component_sql:
	//	base = new DataBase(component);
	//	break;
	case ComponentType::component_robot:
		base = new Robot(component);
		break;
	//case ComponentType::component_systemInfo:
	//	base = new SystemStateInfo(component);
	//	break;
	//case ComponentType::component_algorithm:
	//	base = new AlgorithmManager(component);
	//	break;
	//case ComponentType::component_wcsrec:
	//	base = new WCSReciver(component);
	//	break;
	//case ComponentType::component_wcsSend:
	//	base = new WCSSend(component);
	//	break;
	//case ComponentType::component_stackPlate:
	//	base = new StackPlateManager(component);
	//	break;
	//case ComponentType::component_unstackPlate:
	//	base = new UnstackPlateManager(component);
	//	break;
	//case ComponentType::component_plateStack:
	//	base = new PlateStack(component);
	//	break;
	//case ComponentType::component_boxline:
	//	base = new BoxlineManager(component);
	//	break;
	//case ComponentType::component_alarmLight:
	//	base = new AlarmLight(component);
	//	break;
	//case ComponentType::component_safeLocker:
	//	base = new SafeLocker(component);
	//	break;
	//case ComponentType::component_safeDoor:
	//	base = new SafeDoor(component);
	//	break;
	//case ComponentType::component_grating:
	//	base = new Grating(component);
	//	break;
	//case ComponentType::component_scanner:
	//	base = new Scanner(component);
	//	break;
	//case ComponentType::component_stackInfo:
	//	base = new StackInfoManager(component);
	//	break;
	//case ComponentType::component_taskExcutor:
	//	base = new TaskProcess(component);
	//	break;
	//case ComponentType::component_stateSend:
	//	base = new StatusNotification(component);
	//	break;
	default:
		log_error("错误的组件类型");
		return nullptr;
	}
	return base;
}
